Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enh/liquid motors tank inertia #299

Merged
merged 20 commits into from
Nov 21, 2022

Conversation

phmbressan
Copy link
Collaborator

@phmbressan phmbressan commented Nov 16, 2022

Pull request type

Please check the type of change your PR introduces:

  • Code base additions (bugfix, features)
  • Code maintenance (refactoring, formatting, renaming, tests)
  • ReadMe, Docs and GitHub maintenance
  • Other (please describe):

Pull request checklist

  • Code base additions (for bug fixes / features):

    • Tests for the changes have been added
    • Docs have been reviewed and added / updated if needed
    • Lint (black rocketpy) has passed locally and any fixes were made
    • All tests (pytest --runslow) have passed locally

What is the current behavior?

There is no support for non flat cap inertia evaluation nor the tank gaseous volume.

What is the new behavior?

Expand inertia evaluation for Tanks. The new behavior includes spherical cap inertia calculations and the gaseous portion is taken into account.

Does this introduce a breaking change?

  • Yes
  • No

@phmbressan phmbressan added Enhancement New feature or request, including adjustments in current codes Motors Every propulsion related issue or PR labels Nov 16, 2022
@phmbressan phmbressan added this to the Liquid Motors Support milestone Nov 16, 2022
@giovaniceotto
Copy link
Member

Currently working on this review but haven't finished yet. Expect to finish it by today.

Copy link
Member

@giovaniceotto giovaniceotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there! Implementation is looking awesome. I just made a small number of suggestions.

Comment on lines 18 to 20
def __init__(
self, name, diameter, height, gas, liquid=0, bottomCap="flat", upperCap="flat"
):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Add docstring to describe arguments.

rocketpy/motors/Tank.py Outdated Show resolved Hide resolved
Comment on lines 45 to 47
self.bottomCap = self.capMap.get(self.bottomCap)(
self.diameter / 2, fill_direction="upwards"
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add error handling to deal with non-existent cap types?

rocketpy/motors/Tank.py Outdated Show resolved Hide resolved
Comment on lines 233 to 234
"""Returns the center of mass of the tank's fluids as a function of
time.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Specify relative to which point is the center of mass calculated (coordinate system orientation and origin).

Comment on lines 277 to 278
"""Returns the inertia tensor of the tank's fluids as a function of
time.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: make it clear relative to which origin and axes (coordinate system) is this being calculated.

rocketpy/motors/Tank.py Outdated Show resolved Hide resolved
rocketpy/motors/TankGeometry.py Outdated Show resolved Hide resolved
rocketpy/motors/TankGeometry.py Outdated Show resolved Hide resolved
a cup of water. Most used for bottom caps.
- "downwards": propellant is filled with the concave site facing down, as
in an inverted cup. Most used for upper caps.
The default is "upwards", and will be used if the user commits a typing error.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems dangerous to do this. If the user writes "down", it is use "upwards". I believe implementing error handling would be more appropriate here.

@phmbressan
Copy link
Collaborator Author

Thank you for the review, great points were made! I will analyse and implement the suggested changes today.

@giovaniceotto giovaniceotto merged commit 6771022 into enh/liquid-motors Nov 21, 2022
@giovaniceotto giovaniceotto deleted the enh/liquid-motors-tank-inertia branch March 17, 2023 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request, including adjustments in current codes Motors Every propulsion related issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants